﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Help;
using Model;

namespace BLLA
{
    public partial class View_Order_DishesType : BaseBLL<Model.View_Order_DishesType>, IBLL.IView_Order_DishesTypeBLL
    {
        ObjectSerialize os = new ObjectSerialize();
        DataResult result = new DataResult();


        /// <summary>
        /// 获取商品分类信息
        /// </summary>
        /// <param name="MerID">商户ID</param>
        /// <param name="YZM">验证码</param>
        /// <param name="RETID">数据格式（1：JSON；2：XML）</param>
        /// <returns></returns>
        public string GetOrder_DishesType(string MerID, string YZM, int RETID)
        {
            try
            {
                #region 匹配验证码
                if (YZM != Help.ALL_DataV.YZM)
                {
                    result.BS = "-88";
                    result.Msg = "验证码错误！";
                    return os.StringOfObject(result, RETID);
                }
                #endregion
                List<Model.View_Order_DishesType> ls = new List<Model.View_Order_DishesType>();

                ls = base.GetListBy("SELECT *  FROM View_Order_DishesType where MerID='"+MerID+ "'  order by Postion");
                if (ls != null & ls.Count > 0)
                {
                    result.BS = "1";
                    result.Msg = "查询成功";
                    result.rows = ls;
                    result.total = ls.Count;
                }
                else
                {
                    result.BS = "0";
                    result.Msg = "查询不到数据";
                }
                return os.StringOfObject(result, RETID);
            }
            catch (Exception ex)
            {
                WriteLog.WriteW(" 获取商品分类信息列表失败：" + ex.Message);
                result.BS = "-99";
                result.Msg = "系统错误！";
                return os.StringOfObject(result, RETID);
            }
        }
    }
}
